<%--
  Created by IntelliJ IDEA.
  User: Ningziyi
  Date: 2022/10/27
  Time: 18:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人中心</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/personal_center.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/head_daohang.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.min.js"></script>
</head>
<body>
<script>
    loadInitData();
    // 查询我的所有订单
    function getMyAllOrders(){
        var token = localStorage.getItem("token");
        location.href="${pageContext.request.contextPath}/orders/getOrdersByCustomerId/"+token;
    }

    function  method1() {
        console.log("点击")
        var token  = localStorage.getItem("token");
        location.href="${pageContext.request.contextPath}/customercoupon/getall?token="+token;
        // $(".mycoupon").attr("href","customercoupon/getall?token="+token);

    }
    function loadInitData(){
        console.log("00000000000000")
        var token = localStorage.getItem("token");
        // ----->cpmtollrt toke 你=-----
        console.log("token-----:"+token)

        $.ajax({
            type: "get",
            url: "${pageContext.request.contextPath}/customer/personalData",
            headers: {"token": token},
            success: function (result) {
                console.log(result);
                var loginUser = result.data.loginCustomer;

                if(loginUser != null) {
                    $(".head-color").text(loginUser.custName);
                    $(".head-color").attr("href", "");
                    $(".custName").text(loginUser.custName);
                    $(".customMessage").attr("href","${pageContext.request.contextPath}/customer/getId/"+loginUser.custId + "/get_info");
                    $(".crumbs-person").attr("href","${pageContext.request.contextPath}/customer/getId/" + loginUser.custId)
                    $("#hotCar").attr("href","${pageContext.request.contextPath}/recommendByUser?custId=" + loginUser.custId + "&num=5")
                }else{
                    console.log("2222222")
                    $(".head-color").text("登录");
                    $(".head-color").attr("href", "login/login.jsp");
                }
            }
        })
    }
</script>
<!-- 主要布局范围 -->
<div class="main">
    <!-- 头部导航栏 -->
    <div class="main">
        <!-- 头部导航栏 -->
        <div id="head">
            <div class="layui-col-md2">
                <div class="grid-demo ">
                    <div class="head-logo"></div>
                </div>
            </div>
            <div class="layui-col-md2">
                <div class="grid-demo head-demo"><a href="${pageContext.request.contextPath}/index.jsp" class="word-1">首页</a></div>
            </div>
            <div class="layui-col-md2">
                <div class="grid-demo head-demo"><a href="${pageContext.request.contextPath}/car/getCarView" class="head-hover word-1">自驾租车</a>
                </div>
            </div>
            <%--    <div class="layui-col-md1">--%>
            <%--        <div class="grid-demo head-demo"><a href="${pageContext.request.contextPath}/long_time_older/long_time.jsp" class="head-hover word-1">长租专区</a>--%>
            <%--        </div>--%>
            <%--    </div>--%>
            <div class="layui-col-md2">
                <div class="grid-demo head-demo"><a href=" ${pageContext.request.contextPath}/carOutlets/carAllList" class="head-hover word-1">车型查询</a>
                </div>
            </div>
            <div class="layui-col-md2">
                <div class="grid-demo head-demo"><a href="${pageContext.request.contextPath}/Offline_outlets/Business_outlets.jsp" class="head-hover word-1">营业网点</a></div>
            </div>
            <%--    <div class="layui-col-md1">--%>
            <%--        <div class="grid-demo head-demo"><a href="" class="head-hover word-1">会员专区</a></div>--%>
            <%--    </div>--%>
            <div class="layui-col-md2">
                <div class="grid-demo head-demo1">
                    <i class="login-icon"></i>
                    <a href="${pageContext.request.contextPath}/login/login.jsp" class="head-color">登录/注册</a>
                </div>
                <div class="tel">
                    <i class="tel-icon"></i>
                    <span class="tel-num">110-119-1111</span>
                </div>
            </div>
        </div>
        <!-- 面包屑 -->
        <div class="crumbs">
            <div class="crumbs-bd">当前位置: <a href="${pageContext.request.contextPath}/customer/getId/${cust.custId}" class="crumbs-person">个人中心</a> > </div>
        </div>
        <!-- 主要内容 -->
        <div class="content">
            <div class="content-bd">
                <!-- 左侧导航栏 -->
                <div class="col-sub">
                    <ul>
                        <div class="title">订单信息</div>
                        <li class="text"><a href=javascript:getMyAllOrders()>我的订单</a></li>
                        <%--                    <li class="text"><a href="${pageContext.request.contextPath}/customer/personalCenter-OtherOrler.jsp">他人代订</a></li>--%>
                        <%--                    <div class="title">会员信息</div>--%>
                        <%--                    <li class="text"><a href="">会员优惠</a></li>--%>
                        <%--                    <li class="text"><a href="">会员特权</a></li>--%>
                        <%--                    <li class="text"><a href="">会员积分</a></li>--%>
                        <div class="title">我的钱包</div>
                        <%--                    <li class="text"><a href="${pageContext.request.contextPath}/customer/personalCenter-AccountBalance.jsp">账户余额</a></li>--%>
                        <%--                    <li class="text"><a href="${pageContext.request.contextPath}/customer/personalCenter-Voucher.jsp">我的代金卷</a></li>--%>
                        <li class="text"><a href="javascript:method1()" class="mycoupon">我的优惠编码</a></li>
                        <div class="title">车辆喜好</div>
                        <li class="text"><a href="" id="hotCar">车辆推荐</a></li>
                        <div class="title">个人资料</div>
                        <li class="text"><a href="${pageContext.request.contextPath}/customer/getId/${cust.custId}/get_info" class="customMessage">用户信息</a></li>
                        <li class="text"  onclick="return confirm('即将返回登录界面，确定吗？');"><a href="${pageContext.request.contextPath}/login/login.jsp" class="exit-token">账户注销</a></li>
                    </ul>
                </div>
                <!-- 主要信息栏 -->
                <div class="col-main">
                    <div class="success-pay">
                        <h2>已支付</h2>
                        <p>
                            订单号：${flowData.flowTransactionNumber}
                            <span> | </span>
                            租车人：<label class="custName"></label>
                            <span> | </span>
                            支付方式：${flowData.flowMethod}
                            <span> | </span>
                            支付状态：已支付
                        </p>

                    </div>
                    <div class="car-message">
                        <div class="car-picture"><img src="${pageContext.request.contextPath}/images/本田缤智.png" alt=""><p>租期 <span>2</span>天</p></div>
                        <div class="car-inmessage">
                            <ul>
                                <p>${carData.carName}</p>
                                <li><span class="store-title">取车地点</span><span class="store-title">还车地点</span></li>
                                <li><span>取车门店：${OrderData.data.orderPickupShop}</span><span>还车门店：${OrderData.data.orderPickupShop}</span></li>
                                <li><span>取车时间：${OrderData.data.orderCreatetime}</span><span>还车时间：2023-12-22 22:30</span></li>
                                <li><span>取车地址：${OrderData.data.orderPickupAddress}</span><span>还车地址：${OrderData.data.orderPickupAddress}</span></li>
                            </ul>
                        </div>
                    </div>
                    <div class="money-message">费用明细</div>
                    <div class="money-message-text">
                        <ul>
                            <li>车辆租赁费及门店服务费 (原价：${flowData.flowPayment-100}元，折扣优惠：0.00元) <b>￥<span>${flowData.flowPayment-100}</span></b></li>
                            <li>基本保障服务费 (原价：100.00元，折扣优惠：0.00元)<b>￥<span>100</span></b></li>
                            <li>手续费<b>￥<span>20</span></b></li>
                            <li>优惠折扣<b>￥-<span>0</span></b></li>
                        </ul>
                        <div class="all-money"><label>总计：</label> <b>￥<span>${flowData.flowPayment}</span></b></div>
                        <div class="payed"><label>已支付：</label> <b>￥<span>${flowData.flowPayment}</span></b></div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 尾部 -->
        <div class="footer">
            <div class="footer-box">
                <div class="footer-left">
                    <p>
                        <span>关于无忧</span> |
                        <span>移动客户端</span> |
                        <span>帮助中心</span> |
                        <span>建议专区</span> |
                        <span>联系我们</span> |
                        <span>友情连接</span> |
                        <span>投诉通道：400-821-1608</span>
                    </p>
                    <p>
                        <span>Copyright © 2007-2022 苏州无忧信息技术服务有限公司 ICP证：苏B2-20140130|苏ICP备08010394号-1</span>
                    </p>
                </div>
                <div class="footer-right"></div>
            </div>
        </div>
    </div>
</div>

</body>
</html>
